#include <iostream>
#include <cstring>
#include <unistd.h>
#include <cstdlib>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
using namespace std;

int main()
{
  int fd = open("nameedpipe", O_WRONLY);

  const char* str = "hello world";
  char wbuffer[1024];
  sprintf(wbuffer, "%s", str);
  printf("开始输出数据\n");
  write(fd, wbuffer, strlen(wbuffer));
  printf("输出数据\n");

  close(fd);
  return 0;
}
